//using System;
//using System.Data;
//using System.Configuration;
//using System.Collections;
//using System.Data.SqlClient;
//using System.Collections.Generic;
//using System.Text;
//using Component;

//namespace Component{
//public class Provider : IProvider
//{
//    public SqlConnection GetCnn()
//    {

//string strCnn = Component.Config.GetStrCnn();
//if (strCnn.CompareTo("") != 0){return new SqlConnection(strCnn);
//}
//else return null;
//    }

//     public override ArrayList Category_Get(string sp)
//    {
//using (SqlConnection cnn = GetCnn()){SqlCommand cm = new SqlCommand(sp, cnn);ArrayList al = new ArrayList();
// cnn.Open(); 
//using (SqlDataReader rd = cm.ExecuteReader(CommandBehavior.CloseConnection)){while (rd.Read()){
//Component.CategoryInfo info = new Component.CategoryInfo(
//ConvertType.ToInt(rd["Id"]),ConvertType.ToString(rd["Summary"]),ConvertType.ToString(rd["Name"]),ConvertType.ToString(rd["Content"]),ConvertType.ToString(rd["UrlAdmin"]),ConvertType.ToString(rd["UrlFronent"]),ConvertType.ToInt(rd["Parent"]),ConvertType.ToInt(rd["Priority"]));
    
//al.Add(info);
//}rd.Close();cnn.Close();
//}return al;}}     public override ArrayList ContentManagement_Get(string sp)
//    {
//using (SqlConnection cnn = GetCnn()){SqlCommand cm = new SqlCommand(sp, cnn);ArrayList al = new ArrayList();
// cnn.Open(); 
//using (SqlDataReader rd = cm.ExecuteReader(CommandBehavior.CloseConnection)){while (rd.Read()){
//Component.ContentManagementInfo info = new Component.ContentManagementInfo(
//ConvertType.ToInt(rd["Id"]),ConvertType.ToString(rd["Name"]),ConvertType.ToInt(rd["Priority"]),ConvertType.ToString(rd["NameEl"]),ConvertType.ToString(rd["Url"]),ConvertType.ConverIntToString(ConvertType.ToInt(rd["Active"])),ConvertType.ToInt(rd["Parent"]));
    
//al.Add(info);
//}rd.Close();cnn.Close();
//}return al;}}     public override ArrayList Img_Get(string sp)
//    {
//using (SqlConnection cnn = GetCnn()){SqlCommand cm = new SqlCommand(sp, cnn);ArrayList al = new ArrayList();
// cnn.Open(); 
//using (SqlDataReader rd = cm.ExecuteReader(CommandBehavior.CloseConnection)){while (rd.Read()){
//Component.ImgInfo info = new Component.ImgInfo(
//ConvertType.ToInt(rd["Id"]),ConvertType.ToString(rd["Title"]),ConvertType.ToString(rd["Summary"]),ConvertType.ToString(rd["UrlAdmin"]),ConvertType.ToString(rd["UrlFronent"]),ConvertType.ToInt(rd["Parent"]),ConvertType.ToString(rd["Img"]),ConvertType.ConverIntToString(ConvertType.ToInt(rd["New"])));
    
//al.Add(info);
//}rd.Close();cnn.Close();
//}return al;}}     public override ArrayList LienHe_Get(string sp)
//    {
//using (SqlConnection cnn = GetCnn()){SqlCommand cm = new SqlCommand(sp, cnn);ArrayList al = new ArrayList();
// cnn.Open(); 
//using (SqlDataReader rd = cm.ExecuteReader(CommandBehavior.CloseConnection)){while (rd.Read()){
//Component.LienHeInfo info = new Component.LienHeInfo(
//ConvertType.ToInt(rd["Id"]),ConvertType.ToString(rd["Name"]),ConvertType.ToString(rd["Email"]),ConvertType.ToString(rd["Phone"]),ConvertType.ToString(rd["Adress"]),ConvertType.ToString(rd["Title"]),ConvertType.ToString(rd["Content"]),ConvertType.ToString(rd["UrlAdmin"]),ConvertType.ToString(rd["UrlFronent"]),ConvertType.ToInt(rd["PL"]));
    
//al.Add(info);
//}rd.Close();cnn.Close();
//}return al;}}     public override ArrayList News_Get(string sp)
//    {
//using (SqlConnection cnn = GetCnn()){SqlCommand cm = new SqlCommand(sp, cnn);ArrayList al = new ArrayList();
// cnn.Open(); 
//using (SqlDataReader rd = cm.ExecuteReader(CommandBehavior.CloseConnection)){while (rd.Read()){
//Component.NewsInfo info = new Component.NewsInfo(
//ConvertType.ToInt(rd["Id"]),ConvertType.ToString(rd["Titile"]),ConvertType.ToString(rd["Summary"]),ConvertType.ToDateTime(rd["Date"]),ConvertType.ToString(rd["Content"]),ConvertType.ToString(rd["UrlDetailFronend"]),ConvertType.ToString(rd["UrlDetailBackend"]),ConvertType.ToString(rd["Img"]),ConvertType.ConverIntToString(ConvertType.ToInt(rd["New"])),ConvertType.ConverIntToString(ConvertType.ToInt(rd["Active"])),ConvertType.ToInt(rd["Parent"]));
    
//al.Add(info);
//}rd.Close();cnn.Close();
//}return al;}}     public override ArrayList Users_Get(string sp)
//    {
//using (SqlConnection cnn = GetCnn()){SqlCommand cm = new SqlCommand(sp, cnn);ArrayList al = new ArrayList();
// cnn.Open(); 
//using (SqlDataReader rd = cm.ExecuteReader(CommandBehavior.CloseConnection)){while (rd.Read()){
//Component.UsersInfo info = new Component.UsersInfo(
//ConvertType.ToInt(rd["Id"]),ConvertType.ToString(rd["Name"]),ConvertType.ToString(rd["Phone"]),ConvertType.ToString(rd["Mail"]),ConvertType.ToString(rd["User_name"]),ConvertType.ToString(rd["Pass"]),ConvertType.ToDateTime(rd["Datecreated"]),ConvertType.ToDateTime(rd["Datelogin"]),ConvertType.ConverIntToString(ConvertType.ToInt(rd["Active"])));
    
//al.Add(info);
//}rd.Close();cnn.Close();
//}return al;}}    public override bool DIU(string sp, SqlParameter[] para)
//    {

//bool t = false;using (SqlConnection cnn = GetCnn())
//    {try
//    {cnn.Open();SqlCommand cm = new SqlCommand(sp, cnn);cm.CommandType = CommandType.StoredProcedure;if (para != null)
//    {cm.Parameters.AddRange(para);
//    }if (cm.ExecuteNonQuery() > 0)
//    {t = true;
//    }
//    }
//    catch{
//    }
//    finally{
//    cnn.Close();}
//     return t;}
//    }
//}}